<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Usuario</title>
</head>

<body>
<%
Function Convertir(rs)
    Dim sXsl,oXsl,i
    sXsl = "<?xml version='1.0'?> "
    sXsl = sXsl & "<xsl:stylesheet xmlns:xsl='http://www.w3.org/TR/WD-xsl'> " & _
                  "<xsl:template match='/'> <registros> " & _
                  "<xsl:for-each select='xml/rs:data/z:row'> <registro> "

    With rs
        For i = 0 To .Fields.Count - 1
            sXsl = sXsl & "<" & .Fields(i).Name & "><xsl:value-of select='@" & .Fields(i).Name & "'/></" & rs.Fields(i).Name & "> "
        Next
    End With
    sXsl = sXsl & "</registro> </xsl:for-each> </registros> </xsl:template> </xsl:stylesheet> "


    Set oXsl = Server.CreateObject("MSXML2.DOMDocument")
    oXsl.loadXML (sXsl)
    
    Set Convertir = oXsl
End Function


sUsua = Request.ServerVariables("LOGON_USER")
Session("sUsua") = Mid(sUsua, InStrRev(sUsua, "\", len(sUsua)-1) + 1 )

sSql = " SELECT R.IDRESPONSABLE, R.IDSECTOR, R.USERNAME, R.LEGAJO, Upper(R.APELLIDO) || ', ' ||  Lower(NOMBRE) as RESPONAPENOMBRE, R.IDJERARQUIADATOS, R.EMAIL, R.TELEFONO, '' AS IDREGIONAL,'' AS NOMBREREGIONAL,'' AS RESPONSABLEAUTO, '' IDAREAOPE "
sSql = sSql & " FROM miev2_unao.RESPONSABLES R "
sSql = sSql & " WHERE R.USERNAME = 'YP00908'"

Set oBD = Server.CreateObject("CCDBServ.cDB")
Set oConn = oBD.DbOpen("TNQN", "", 1, "miev2_unao", "miev2o")

   
Set oRs = oBD.DbExecuteRs(Cstr(sSql))
'Response.write(oRs("USERNAME"))
'response.End()
set x = Convertir(oRs)
%>
</body>
</html>
